<?php
/**
 * @name /conf/ini.php
 * @author Michael Foss <mfoss@clarionsafety.com>
 * @version 2007.07.28
 *
 * In this file, basic initialization takes place.
 */

ini_set('short_open_tag', 'On');

@session_start();

// Include configuration data
require_once('conf.php');

global $Config, $INCROOT, $WEBROOT, $SWEBROOT, $OS;
switch ($Config->Scheme) {
  case 'ESU_xampplite_SKM':
    $INCROOT = 'C:/xampplite/htdocs/SKM/skm_libconf';
    $WEBROOT = 'http://localhost:8080/SKM/skm_www';
    $SWEBROOT = $WEBROOT;
    $OS = 'Windows';
    $GLOBALS['dbInfo']['USER'] = 'skm';
    $GLOBALS['dbInfo']['PASS'] = 'skm1234';
    $GLOBALS['dbInfo']['NAME'] = 'charity';
    $GLOBALS['dbInfo']['HOST'] = 'localhost';
    break;
}

ReqLib('/lib/public/StdLib.php');
ReqLib('/lib/public/DB.php');

// Are we supposed to be secure and we're not? Redirect!
if (substr(_phpSelf(false), 0, 7) == 'http://' && $framework->PageParams->IsSecure) {
  header('location: https://' . substr(_phpSelf(), 7, ''));
  die();
}
// Are we supposed to be insecure and we're not or can't be? Redirect!
if (substr(_phpSelf(false), 0, 8) == 'https://')
  if (!$Config->CanBeSecure || !$framework->PageParams->IsSecure) {
    header('location: http://' . substr(_phpSelf(), 8, ''));
    die();
  }